CRIAR O ARQUIVO bloqueado.php
NAS PASTAS PRINCIPAL ONDE VOCE QUER QUE BLOQUEI
EXEMPLO SE QUER QUE BLOQUEI O LOGIN.PHP OU INDEX

CRIA O ARQUIVO bloqueado.php
 NO MESMO LUGAR ONDE ESTA CRIADO O LOGIN.PHP OU INDEX
 
 
 
 CONTEUDO DO ARQUIVO bloqueado.php:
 
 <?php
// Conecta ao banco de dados
$db_host = 'localhost';
$db_name = 'seu banco de dados aqui'; 
$db_user = 'seu banco de dados aqui'; 
$db_pass = 'senha do banco de dados aqui';

$pdo = new PDO("mysql:host=$db_host;dbname=$db_name", $db_user, $db_pass);

// Buscar logo nas configurações
$config = $pdo->query("SELECT logo FROM configuracoes LIMIT 1")->fetch(PDO::FETCH_ASSOC);
$logo = $config['logo'] ?? 'logo.png';


// Token do Mercado Pago
$token = 'APP_USR-1017418177003611-081623-8a8dd68e71e7fc1aad1bd29e91325b39-1950953558';

// Pega o dominio atual
$dominio = $_SERVER['HTTP_HOST'];

// Busca o cliente
$stmt = $pdo->prepare("SELECT * FROM clientes WHERE dominio = ?");
$stmt->execute([$dominio]);
$cliente = $stmt->fetch(PDO::FETCH_ASSOC);
$status = $cliente['status'];

if ($status === 'vencido') {
    $tituloMsg = '⚠️ Acesso Vencido';
    $mensagem = 'Sua licença expirou por falta de pagamento ou vencimento da licença. Para continuar utilizando o sistema, realize o pagamento abaixo.';
    $mostrarPagamento = true;
    $mostrarSuporte = false;
} elseif ($status === 'bloqueado') {
    $tituloMsg = '🔒 Acesso Bloqueado';
    $mensagem = 'Este sistema foi bloqueado. Para saber mais, contate o suporte abaixo.';
    $mostrarPagamento = false;
    $mostrarSuporte = true;
}


if (!$cliente || !in_array($cliente['status'], ['bloqueado', 'vencido'])) {
    echo "Acesso liberado ou cliente não encontrado.";
    exit;
}

$valor = number_format($cliente['preco'], 2, '.', '');
$referencia = $cliente['dominio'];

// Gerar o cabeçalho X-Idempotency-Key
$idempotency_key = uniqid('idempotency_', true); // Gera uma chave única para cada requisição

// Dados da transação
$dados = [
    "transaction_amount" => (float)$valor,
    "description" => "Renovação de acesso $dominio",
    "payment_method_id" => "pix", // Certifique-se de que "pix" é um método de pagamento válido no Mercado Pago
    "payer" => ["email" => "pagador@spxtv.com"], // Alterar para o email real do cliente
    "notification_url" => "https://gerenciarlcs.spxtv.top/webhook.php",
    "external_reference" => $referencia
];

// Iniciar CURL para enviar dados ao Mercado Pago
$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.mercadopago.com/v1/payments",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => json_encode($dados),
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json",
        "Authorization: Bearer $token",
        "X-Idempotency-Key: $idempotency_key" // Adicionando o cabeçalho X-Idempotency-Key
    ]
]);

$resposta = curl_exec($curl);

// Verifique se a requisição foi bem sucedida
if ($resposta === false) {
    error_log("Erro na requisição: " . curl_error($curl));  // Registrar o erro no log de erros
    exit;
}

curl_close($curl);

// Decodificando a resposta
$dados_pagamento = json_decode($resposta, true);

// Exibir o erro detalhado no log, mas não mostrar na interface
if (isset($dados_pagamento['error'])) {
    error_log("Erro do Mercado Pago: " . print_r($dados_pagamento['error'], true)); // Registrar o erro no log de erros
    exit;
}

// Verificar se o QR code foi retornado
if (!isset($dados_pagamento['point_of_interaction']['transaction_data']['qr_code_base64'])) {
    error_log("Erro ao gerar QR Code: A resposta do Mercado Pago não contém dados válidos para o pagamento."); // Registrar o erro no log de erros
    exit;
}

// Obter QR Code
$qr_code = $dados_pagamento['point_of_interaction']['transaction_data']['qr_code_base64'] ?? '';
$copiar = $dados_pagamento['point_of_interaction']['transaction_data']['qr_code'] ?? '';

?>

<!DOCTYPE html>
<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <title>Acesso Bloqueado</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <style>
        body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  background: radial-gradient(circle at center, #0a0a0a, #000000 70%);
  background-size: 200% 200%;
  animation: luzLed 5s ease-in-out infinite alternate;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  position: relative;
}

@keyframes luzLed {
  0% {
    background-position: 0% 50%;
    filter: brightness(1);
  }
  100% {
    background-position: 100% 50%;
    filter: brightness(1.1);
  }
}

        .container {
            background-color: #111;
            padding: 30px;
            border-radius: 10px;
            max-width: 500px;
            margin: auto;
            box-shadow: 0 0 20px red;
        }

        .container h1 {
            color: red;
            margin-bottom: 20px;
        }

        button {
            background-color: red;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
        }

        #pixModal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.8);
            justify-content: center;
            align-items: center;
        }

        #pixModalContent {
            background: #111;
            padding: 30px;
            border-radius: 10px;
            text-align: center;
        }

        input {
            width: 100%;
            padding: 10px;
            border-radius: 5px;
            margin-top: 10px;
        }
    </style>
</head>
<body>
<div class="container">
    <div style="text-align: center;">
  <img src="https://gerenciarlcs.spxtv.top/uploads/<?= $logo ?>" alt="Logo do Sistema" style="max-width: 180px; margin-bottom: 20px;">
</div>

    <?php if ($status === 'vencido'): ?>
    <h1 style="color: red; font-size: 26px;">⚠️ Acesso Vencido</h1>
    <p style="font-size: 15px; line-height: 1.6; margin-top: 10px;">
        Sua licença foi <strong>temporariamente suspensa</strong> por <strong>falta de pagamento</strong> ou <strong>vencimento da assinatura</strong>.<br><br>
        Para continuar utilizando o sistema normalmente, realize o pagamento logo abaixo.
    </p>
    <div style="display: flex; align-items: center; justify-content: center; gap: 6px; background-color: #1c1c1c; padding: 8px 14px; border-radius: 6px; margin-top: 18px; box-shadow: 0 0 6px #ff1a1a;">
  <span style="font-size: 16px;">💰</span>
  <span style="font-size: 13px; color: #ffcc66; font-weight: 500;">
      Valor a ser pago:
  </span>
  <span style="font-size: 15px; color: #ff5c5c; font-weight: bold;">
      R$ <?= number_format($valor, 2, ',', '.') ?>
  </span>
</div>


<?php else: ?>
    <h1 style="color: #ff4444; font-size: 24px; display: flex; align-items: center; gap: 8px; justify-content: center;">
    <span style="font-size: 26px;">🔒</span> Acesso Bloqueado
</h1>

<p style="margin-top: 20px; font-size: 15px; color: #ddd; line-height: 1.6; text-align: center;">
    Este sistema foi <strong style="color: #ff4444;">bloqueado</strong> devido a <strong style="color: #ff4444;">violação de regras</strong> ou <strong style="color: #ff4444;">inadimplência contratual</strong>.<br>
    Para recuperar o acesso e mais informações, entre em contato com o suporte imediatamente.
</p>

<?php endif; ?>

    <?php if ($mostrarPagamento): ?>
    <br>
    <button onclick="document.getElementById('pixModal').style.display='flex'">Pagar Agora</button>
<?php elseif ($mostrarSuporte): ?>
    <br><br>
    
    <a href="https://wa.me/558188236670" target="_blank"
   style="display: inline-block; background-color: red; color: white; padding: 10px 20px; border-radius: 5px; text-decoration: none; font-size: 16px; font-weight: 500; box-shadow: none;">
   Suporte via WhatsApp
</a>


<?php endif; ?>

</div>

<div id="pixModal">
    <div id="pixModalContent">
        <h2>Pagamento via Pix</h2>
        <?php if ($qr_code && $copiar): ?>
            <img src="data:image/png;base64,<?= $qr_code ?>" alt="QR Code Pix" width="200"><br>
            <input type="text" id="codigoPix" value="<?= $copiar ?>" readonly>
            <br><br>
            <button onclick="copiarPix()">Copiar Código Pix</button>
        <?php else: ?>
            <p>Erro ao gerar o pagamento. Tente novamente.</p>
        <?php endif; ?>
        <br><br>
        <button onclick="document.getElementById('pixModal').style.display='none'">Fechar</button>
    </div>
</div>

<script>
    function copiarPix() {
        let input = document.getElementById("codigoPix");
        input.select();
        document.execCommand("copy");
        alert("Código Pix copiado!");
    }

    // Função para verificar se o pagamento foi feito
    function verificarPagamento() {
        fetch('/verificar_status_pagamento.php') // Faz a requisição para verificar o status
            .then(response => response.json())
            .then(data => {
                if (data.status === 'pago') {
                    alert("Pagamento confirmado! Acesso liberado.");
                    location.reload();  // Recarregar a página para mostrar o acesso liberado
                } else {
                    setTimeout(verificarPagamento, 5000);  // Verifica novamente após 5 segundos
                }
            });
    }

    // Verifica o pagamento assim que a página for carregada
    window.onload = verificarPagamento;
</script>
</body>
</html>

TERMINA AQUI.